//
//  CommentViewController.m
//  eBook
//
//  Created by Dimaginexus on 14-5-15.
//  Copyright (c) 2014年 zhan. All rights reserved.
//

#import "CommentViewController.h"

@interface CommentViewController ()

@end

@implementation CommentViewController

@synthesize CommentVCDelegate;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

#pragma mark - tableView delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 4;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"CommentCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil)
    {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    
    UILabel *typeLabel = (UILabel *)[cell viewWithTag:100];
    UILabel *userLabel = (UILabel *)[cell viewWithTag:101];
    UILabel *eventLabel = (UILabel *)[cell viewWithTag:102];
    UILabel *contentLabel = (UILabel *)[cell viewWithTag:103];
    
    switch (indexPath.row)
    {
        case 0:
            typeLabel.text = @"video";
            userLabel.text = @"小莫";
            eventLabel.text = @"上传了视频";
            contentLabel.text = @"\"SPSS使用指南\"";
            break;
        case 1:
            typeLabel.text = @"video";
            userLabel.text = @"时光";
            eventLabel.text = @"上传了视频";
            contentLabel.text = @"\"答辩问题\"";
            break;
        case 2:
            typeLabel.text = @"pic";
            userLabel.text = @"小莫";
            eventLabel.text = @"上传了图片";
            contentLabel.text = @"\"论文题目\"";
            break;
        case 3:
            typeLabel.text = @"audio";
            userLabel.text = @"吴凡";
            eventLabel.text = @"上传了音频";
            contentLabel.text = @"\"论文选题\"";
            break;
        default:
            break;
    }
    
    return cell;
}

-(BOOL) tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
    return NO;
}

#pragma actions

- (IBAction)dismissVC:(id)sender
{
    [XAppDelegate.stackVC popViewControllerAnimated:YES];
    [CommentVCDelegate commentVCBackToMenu];
}

- (IBAction)addComment:(id)sender
{
    
}

@end
